<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>HTML模板引擎--绑定数据</h2>
    <p><%=userInfo.name%></p>
    <p><%=userInfo.age%></p>
    <h2>循环遍历</h2>
    <ul>
        <%for(let i = 1; i < userInfo.hobbies.length; i++){%>
        <li><%=userInfo.hobbies[i]%></li>
        <%}%>
    </ul>
    <p><%=userInfo.address.city + userInfo.address.street%></p>

    <h2>渲染HTML代码标签</h2>
    <%=article.title%>
    <%-article.content%>

    <h2>条件判断</h2>
    <% if (userInfo.age > 18) { %>
        <p>成年</p>
    <% } else { %>
        <p>未成年</p>
    <% } %>

    <h2>使用include引入其他模板</h2>
    <%- include("header.html") %>
    <%- include("./common/footer.html") %>
</body>
</html>